<template>
  <div class="tabs">
    <div class="page-inner">
      <ul>
        <li
          v-for="(i, index) in tabsList"
          :key="index"
          :class="`font-m f16 ${
            tabsActive == 'true'
              ? 'active'
              : (i.url == $route.path||isCurrent(i.outlink,$route.path))
              ? 'active'
              : 'inactive'
          }`"
        >
          <NuxtLink @click="toLink(i.outlink)">{{ i.name }}</NuxtLink>
        </li>
      </ul>
    </div>
  </div>
</template>
<script setup>
import { ref } from "vue";
const isCurrent=(url,rout)=>{
  return rout.indexOf(url)==0&&rout.indexOf(url+'/')!=0
};
const toLink=(url)=>{
	window.location.href='/cn'+url
};

defineProps(["tabsList", "tabsActive"]);
</script>